package com.gr



import grails.test.mixin.*
import org.junit.*

/**
 * See the API for {@link grails.test.mixin.services.ServiceUnitTestMixin} for usage instructions
 */
@TestFor(DivisionService)
@Mock([Division])
class DivisionServiceTests {

	/**
	 * getlistAll()
	 */
	void testgetlistAll() {
		
		def divA = new Division(title:"DivisionA", email:"divisiona@duorg.com", startDate:new Date("2011/3/21")).save(validate: false)
		def divB = new Division(title:"DivisionB", email:"divisiona@duorg.com", startDate:new Date("2011/3/21")).save(validate: false)

		def model = new DivisionService().getlistAll()

		assert model.size() == 2
		assert model[0].text == "DivisionA"
		assert model[0].id == "DivisionA"
		assert model[1].text == "DivisionB"
		assert model[1].id == "DivisionB"
	}
}
